<?php
namespace Home\Controller;
use Think\Controller;
class MessageController extends HomeController {

	/**
	 * 初始化
	 */
	public function __construct() {
		parent::__construct();
	}
	
	/**
	 * 留言
	 */
	public function index() {
		if(IS_POST) {
			$data['mtitle'] = I('post.mtitle','','strip_tags');
			$data['mcontent'] = I('post.mcontent','','strip_tags');
			$data['mtime'] = time();
			$data['muid'] = $this->userinfo['id'];
			$msg = D('message')->add($data);
			if($msg) {
				jssuccess('操作成功！',U('Message/index'));
			} else {
				jserror('操作失败！',U('Message/index'));
			}
		}
		/**jssdk***/
		$signPackage = $this->signPackage;
		$signPackage['title'] = "苗木通讯录";
		$signPackage['link'] = 'http://'.C('DOMAIN').U('Message/index');
		$signPackage['desc'] = "众里寻他千百度，苗友尽在通讯录，苗商驰骋天地间，买卖沟通更方便。";
		$signPackage['imgUrl'] = 'http://zhumeng777.com/Uploads/2016-09-18/57de84aca6a35.jpg';
		$this->assign('signPackage',$signPackage);
		/****/
		$this->display();
	}
	
}
